<link rel="stylesheet" type="text/css" href="<?php echo base_url('resources');?>/css/user/duan_style.css" />
<script language = "javascript" src='<?php echo base_url(); ?>/ckeditor/ckeditor.js' type="text/javascript"></script>
<script src="<?php echo base_url('resources/jquery-ui-1.10.3/jquery-1.9.1.js');?>"></script>
<div id="menuduan">
    <ul id="menuduan-menu">
        <li><a href="<?php echo base_url('nhanvien/duan/HienThiDanhSachNhiemVu?id='). $duan;?>">Nhiệm vụ</a></li>
        <li><a href="<?php echo base_url('nhanvien/duan/XemHoiThoaiTraoDoi?id='). $duan;?>">Hội thoại trao đổi</a></li>
        <li><a href="<?php echo base_url('nhanvien/duan/XemDanhSachBaoCaoDinhKy?id='). $duan;?>">Báo cáo định kỳ</a></li>
    </ul>
</div>
<div id="duanhoatdong">
    <form id="comment-form" action="<?php echo base_url('nhanvien/duan/HoiThoaiTraoDoi?id='). $duan;?>" method="post" enctype="multipart/form-data">
    <fieldset>
    	<legend>Leave a comment</legend>
        <div>
            <label for="comment">Your Comment: </label>
            <div class="comment">
                <textarea id="comment" name="comment" rows="10" cols="50" tabindex="1"></textarea>
                <?php echo display_ckeditor($ckeditor); ?>
                <span id="available"></span>
            </div>
        </div>
        <p class="warning">Chú ý: các tài liệu cần thiết nén vào 1 file rar hoặc zip</p>
        <input type="file" name="dinhkem" value="Chọn file"/>
    </fieldset>
    <div><input class="submit" type="submit" name="submit" value="Post Comment" /></div>
</form>
</div>
<script>
    $(document).ready(function(){
        $('#comment').change(function() {
            var comment = $(this).val();
            if(comment.length > 30) {
                $('#available').html('<span class="ok">Nội dung hợp lệ.</span>');
            } else {
                $('#available').html('<span class="short">Comment phải dài hơn 30 kí tự.</span>');
            }
        });
    });
</script>
<?php
    echo "<ol id='disscuss'>";
    for($i=0; $i<sizeof($result); $i++){
            echo "<li>
                <p class='author'>{$result[$i]['UserName']}</p>
                <p class='comment'>{$result[$i]['NoiDung']}</p>
                ";
            if($result[$i]['LinkFile']){
                echo "<p class='tailieu'><a href='../../{$result[$i]['LinkFile']}'>Download Tài liệu</a></p>";
            }
            echo "</li>";   
    }
    echo "</ol>";
?>